﻿using System;

namespace Pfz.WpfControls
{
	/// <summary>
	/// Create classes that implement this interface and, if the assembly is referenced during load-time
	/// such class will be instantiated and its IsReadOnly function will be registered.
	/// </summary>
	public interface IAutoRegisterIsDataSourceReadOnlyFunction
	{
		/// <summary>
		/// The type of DataSource this interface is capable of verifying for read-only.
		/// </summary>
		Type DataSourceType { get; }

		/// <summary>
		/// A value indicating if sub-types of the DataSourceType are to be processed using
		/// this.
		/// </summary>
		bool CanUseForSubTypes { get; }

		/// <summary>
		/// Must verify object for read-only.
		/// </summary>
		bool IsReadOnly(object obj);
	}
}
